import requests
import unittest
from ddt import ddt, file_data

@ddt
class A3mall(unittest.TestCase):
    def setUp(self) -> None:
        print('start case')

    def tearDown(self) -> None:
        print('end case')

    # 注册
    myinfo=None
    @file_data('data.yaml')
    def test_A3mall_01(self,username,password,hope):
        register = requests.post(url='http://10.59.9.14:7003/api/register',
                                 json={"username": username, "password": password})
        # 提取info
        A3mall.myinfo = register.json()['info']
        print(register.json())
        if hope == '正':
            self.assertEqual('注册成功！',A3mall.myinfo)
        else:
            return



if __name__ == '__main__':
    unittest.main()
